﻿using System;
using System.Drawing;
using System.IO;

namespace CloudShot.ImageStorages
{
	class ImageStorage : FileStorageBase, IImageStorage
	{
		public override Image Logo { get { return null; } }
		public override string Name { get { return "File Image Storage"; } }

		public ImageStorage(string root)
			: base(root)
		{
		}

		public override bool SupportsSaveToFileSystem
		{
			get { return true; }
		}

		public override bool IsShotInStorege(ShotInfo shotInfo)
		{
			if (shotInfo == null || shotInfo.Url == null || string.IsNullOrEmpty(shotInfo.Path))
				return false;

			return File.Exists(shotInfo.Path);
		}

		protected override Uri GetPublicUrl(string path)
		{
			return new Uri(path);
		}
	}
}
